package vn.edu.hcmuns.selab.arm.ui.perspective;

import org.eclipse.core.internal.resources.Folder;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
import org.eclipse.ui.ide.IDE;

import vn.edu.hcmuns.selab.arm.ui.ARMPlugin;

public class ARMPerspectiveFactory implements IPerspectiveFactory {

    @Override
    public void createInitialLayout(IPageLayout layout) {
        //defineActions(layout);
        //defineLayout(layout);
    }

    public void defineActions(IPageLayout layout) {
        
        // Add "show views".
        layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
        layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS);
        layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
        layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET);
        layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
        layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
        
        layout.addPerspectiveShortcut(ARMPlugin.ARM_PERSPECTIVE);
        layout.addPerspectiveShortcut(IDE.RESOURCE_PERSPECTIVE_ID);
    }

    public void defineLayout(IPageLayout layout) {
        // Editors are placed for free.
        String editorArea = layout.getEditorArea();

        layout.addView("org.eclipse.ui.navigator.ProjectExplorer", IPageLayout.LEFT, 0.25f, editorArea);
        layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.BOTTOM, 0.65f, "org.eclipse.ui.navigator.ProjectExplorer");
        
        IFolderLayout bottom = layout.createFolder("bottom_pane", IPageLayout.BOTTOM, 0.70f, editorArea);
        bottom.addView(IPageLayout.ID_PROBLEM_VIEW);
        bottom.addView(IPageLayout.ID_TASK_LIST);
        bottom.addView(IPageLayout.ID_PROP_SHEET);
        
        // Debug
    }

}
